// http.js
import axios from "axios";

const httpInstance = axios.create({
  //baseURL: 'http://pcapi-xiaotuxian-front-devtest.itheima.net',
  baseURL: import.meta.env.VITE_APP_BASE_URL,
  timeout: 5000,
})

// 配置拦截器
httpInstance.interceptors.request.use(config =>{
  return config
})

// 响应拦截器
httpInstance.interceptors.response.use(res=>res.data, e=>{
  return Promise.reject(e)
})

export default httpInstance
